package com.service;

import java.util.List;

import com.dao.BaseDao;
public class managerService<T> {
	private BaseDao dao;

	public T ManagerLogin(String userName,String password) throws Exception{
		if(userName == null || password == null) return null;
		String queryString = "FROM Manager manager WHERE manager.name = '"+userName +"' AND manager.pwd = '"+password+"'";
		List<T> manager = dao.getObjects(queryString);
		return manager.get(0);
	}
	
	public void MgPwdEdit(T manager) throws Exception{
		dao.updateObject(manager);
	}
	
	public void AddMg(T manager) throws Exception{
		dao.addObject(manager);
	}
	
	public BaseDao getDao() {
		return dao;
	}

	public void setDao(BaseDao dao) {
		this.dao = dao;
	}


}